{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "2_process_userproex.ipynb",
      "version": "0.3.2",
      "provenance": [],
      "collapsed_sections": [],
      "include_colab_link": true
    },
    "kernelspec": {
      "display_name": "Python [default]",
      "language": "python",
      "name": "python3"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/GavinHacker/recsys_model/blob/master/2_process_userproex.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "metadata": {
        "id": "w4_ScSJGWGUB",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "## 数据处理Part 2\n",
        "* 处理用户的属性，通过用户的rat, 构造统计特征，max，min, avg, medium\n",
        "\n",
        "#### 需要每次构建模型都执行"
      ]
    },
    {
      "metadata": {
        "id": "IqsnjhUmWGUE",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "#!python --version"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "metadata": {
        "id": "2eTZNCcoWGUH",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "import pandas as pd\n",
        "import pymysql\n",
        "import pymysql.cursors\n",
        "from functools import reduce\n",
        "import numpy as np\n",
        "import pandas as pd\n",
        "import uuid\n",
        "import datetime"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "metadata": {
        "id": "8iLFy3OFWGUL",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "def get_connection():\n",
        "    return pymysql.connect(host='rm-2zeqqm6994abi7b6dqo.mysql.rds.aliyuncs.com',\n",
        "                               user='noone',\n",
        "                               password='Huawei12#$',\n",
        "                               db='recsys',\n",
        "                               port=3306,\n",
        "                               charset ='utf8',\n",
        "                               use_unicode=True)"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "metadata": {
        "id": "K_-SUg76eBoO",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "## 插入和更新一条用户统计信息"
      ]
    },
    {
      "metadata": {
        "id": "CsqX27UjWGUO",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "def insert_or_update_one_userproex(userid, rmax, rmin, ravg, rmedium, rcount, rsum):\n",
        "    print('insert_or_update_one_userproex start')\n",
        "    is_insert = True\n",
        "    connection = get_connection()\n",
        "    try:\n",
        "        sql = 'select count(*) from userproex where userid=\\'%s\\'' % userid\n",
        "        with connection.cursor() as cursor:\n",
        "            cursor.execute(sql)\n",
        "        connection.commit()\n",
        "        res_cnt = cursor.fetchall()[0][0]\n",
        "        if res_cnt > 0:\n",
        "            is_insert = False\n",
        "    except Exception as e:\n",
        "        print('query for exist info error'+str(e))\n",
        "        \n",
        "    if is_insert:\n",
        "        sql = 'insert into userproex(userid, rmax, rmin, ravg, rcount, rsum, rmedian) values(\\'%s\\', %s, %s, %s, %s, %s, %s)' % (userid, rmax, rmin, ravg, rcount, rsum, rmedium)\n",
        "    else:\n",
        "        sql = 'update userproex set rmax=%s, rmin=%s, ravg=%s, rmedian=%s, rcount=%s, rsum=%s where userid=\\'%s\\'' % (rmax, rmin, ravg, rmedium, rcount, rsum, userid)\n",
        "    \n",
        "    try:\n",
        "        with connection.cursor() as cursor:\n",
        "            cursor.execute(sql)\n",
        "        connection.commit()\n",
        "        print(('insert userid:' if is_insert else 'update userid:') + str(userid) + ' success.')\n",
        "    except Exception as e:\n",
        "        print(e)\n",
        "        connection.close()\n",
        "    connection.close()\n",
        "  \n",
        "# 测试代码\n",
        "# insert_or_update_one_userproex('99', 9.1234567, 3.9, 5, 7, 9, 1.1111111)"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "metadata": {
        "id": "L_mBysCleJhG",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "## 更新一条用户评分中位数"
      ]
    },
    {
      "metadata": {
        "id": "N4cdLKv7WGUS",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "def insert_or_update_one_userproex_4_median(userid, rmax, rmin, ravg, rmedian, rcount, rsum, connection):\n",
        "    print('insert_or_update_one_userproex_4_median start')\n",
        "    is_insert = True\n",
        "    try:\n",
        "        sql = 'select count(*) from userproex_new where userid=\\'%s\\'' % userid\n",
        "        with connection.cursor() as cursor:\n",
        "            cursor.execute(sql)\n",
        "        res_cnt = cursor.fetchall()[0][0]\n",
        "        if res_cnt > 0:\n",
        "            is_insert = False\n",
        "    except Exception as e:\n",
        "        print('query for exist info error'+str(e))\n",
        "        \n",
        "    if is_insert:\n",
        "        print('异常数据'+str(userid))\n",
        "        return\n",
        "    else:\n",
        "        sql = 'update userproex_new set rmedian=%s where userid=\\'%s\\'' % (rmedian, userid)\n",
        "    \n",
        "    try:\n",
        "        with connection.cursor() as cursor:\n",
        "            cursor.execute(sql)\n",
        "        print(('insert userid:' if is_insert else 'update userid:') + str(userid) + ' success.')\n",
        "    except Exception as e:\n",
        "        print(e)\n",
        "        connection.close()"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "metadata": {
        "id": "IdiOxg69ecYF",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "## 针对每一个用户，处理统计数据其中包含max,min...等"
      ]
    },
    {
      "metadata": {
        "id": "T8ovY_nKWGUY",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "def process_per_user(userid, insert_or_update_func):\n",
        "    connection = get_connection()\n",
        "    \n",
        "    rmedian = 0\n",
        "    rmax = 0\n",
        "    rmin = 0\n",
        "    ravg = 0\n",
        "    rcount = 0\n",
        "    rsum = 0\n",
        "    \n",
        "    sql = 'select rating from comment_new where userid=\\'%s\\'' % userid\n",
        "    try:\n",
        "        with connection.cursor() as cursor:\n",
        "            count = cursor.execute(sql)\n",
        "        rlist = cursor.fetchall()\n",
        "        rmedian = np.median(np.array(list(map(lambda x:x[0], rlist))).astype(float))\n",
        "    except Exception as e:\n",
        "        print(e)\n",
        "        connection.close()\n",
        "    \n",
        "    sql = 'select max(rating) as rmax, min(rating) as rmin, avg(rating) as ravg, count(rating) as rcount, sum(rating) as rsum from comment_new where userid=\\'%s\\'' % userid\n",
        "    try:\n",
        "        count = 0\n",
        "        with connection.cursor() as cursor:\n",
        "            count = cursor.execute(sql)\n",
        "        if count > 0:\n",
        "            r = cursor.fetchone()\n",
        "            rmax, rmin, ravg, rcount, rsum = r[0], r[1], r[2], r[3], r[4]\n",
        "    except Exception as e:\n",
        "        print(e)\n",
        "        connection.close()\n",
        "    insert_or_update_func(userid=userid, rmax=rmax, rmin=rmin, ravg=ravg, rmedium=rmedian, rcount=rcount, rsum=rsum)\n",
        "    connection.close()"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "metadata": {
        "id": "6EF6HbHUezFp",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "## 全量处理数据，只处理median，由于max,min等都有内置函数，所以直接sql处理"
      ]
    },
    {
      "metadata": {
        "id": "apxwFnlrWGUi",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "def process_per_user_median(userid, insert_or_update_func, connection):\n",
        "    rmedian = 0\n",
        "    rmax = 0\n",
        "    rmin = 0\n",
        "    ravg = 0\n",
        "    rcount = 0\n",
        "    rsum = 0\n",
        "    sql = 'select rating from comment_new where userid=\\'%s\\'' % userid\n",
        "    try:\n",
        "        with connection.cursor() as cursor:\n",
        "            count = cursor.execute(sql)\n",
        "        rlist = cursor.fetchall()\n",
        "        rmedian = np.median(np.array(list(map(lambda x:x[0], rlist))).astype(float))\n",
        "    except Exception as e:\n",
        "        print(e)\n",
        "        connection.close()\n",
        "    \n",
        "    insert_or_update_func(userid=userid, rmax=rmax, rmin=rmin, ravg=ravg, rmedian=rmedian, rcount=rcount, rsum=rsum, connection=connection)"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "metadata": {
        "id": "6oIqRPB2WGUl",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "## 全量处理数据\n",
        "\n",
        "* 1.执行sql，处理除中位数的其他统计值\n",
        "\n",
        "    -- delete from userproex_new\n",
        "    -- INSERT INTO userproex_new (userid, rmax, rmin, ravg, rcount, rsum) (select userid, max(rating) as rmax, min(rating) as rmin, avg(rating) as ravg, count(rating) as rcount, sum(rating) as rsum from comment_new group by userid having userid is not null)\n",
        "\n",
        "* 2.执行中位数更新"
      ]
    },
    {
      "metadata": {
        "id": "rkElM_kuWGUl",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "def get_user_list_in_comment(is_all_or_sample, process_func, insert_or_update_func):\n",
        "    connection = get_connection()\n",
        "    if is_all_or_sample:\n",
        "        sql = 'select DISTINCT userid from comment_new where userid is not null and userid in (select userid from userproex_new where rmedian=0)'\n",
        "    else:\n",
        "        sql = 'select DISTINCT userid from comment_new where userid is not null and userid in (select userid from userproex_new where rmedian=0) limit 0,10'\n",
        "        \n",
        "    try:\n",
        "        with connection.cursor() as cursor:\n",
        "            cursor.execute(sql)\n",
        "        connection.commit()\n",
        "        process_size = 0\n",
        "        while True:\n",
        "            r = cursor.fetchone()\n",
        "            if r == None:\n",
        "                break\n",
        "            process_func(r[0], insert_or_update_func, connection)\n",
        "            process_size = process_size + 1\n",
        "            if process_size >= 1000:\n",
        "                connection.commit()\n",
        "                process_size = 0\n",
        "        connection.commit()\n",
        "    except Exception as e:\n",
        "        print(e)\n",
        "        connection.close()\n",
        "    connection.close()"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "metadata": {
        "id": "z2Rxr14-WGUo",
        "colab_type": "code",
        "outputId": "10c4cb1e-0d87-47da-f867-d4d0715f67b4",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "print(datetime.datetime.now())\n",
        "start_time = datetime.datetime.now()"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "2018-12-19 15:58:07.804579\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "metadata": {
        "id": "E7CskYV2fEXq",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "## 执行主函数"
      ]
    },
    {
      "metadata": {
        "id": "yULaHoElWGUt",
        "colab_type": "code",
        "outputId": "cf25333a-a941-4ec2-897d-44ced077425d",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "get_user_list_in_comment(True, process_per_user_median, insert_or_update_one_userproex_4_median)"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff9a0434038d5ad817c7a2b603eae73e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff44570aca8241914870afbc310cdb85 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff5bb67db636a8cf08cac6617f1954ca success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feb77f1c2ec488cfb38acb7c602573f8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa23ca940c927a962d02c57b0eb9700 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fec6bb6d24d9e5eb405ffe22420786e6 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fed9f34b314fb2aa0d7c59593fa35241 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffbd23a0248e1ee2ae890fafbc4240b6 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fed792c007ce53a4c86d175139bd08cd success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe792c95601128531e2c534b6639b9bb success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe4c5ae0b791dc26426f5427580419fe success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe6f613b60c8e83f79a7425275787637 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fedafd1d1383b415c0e7fc5a6561e095 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe93b62e7b8b2cc9fa8d43bf5ff35f70 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe4b74fa1cace8f51710b47b6561993d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffc54d8dfc60239eadbb470beedeabee success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff9bd138f40559d23a1b8b06630e4e67 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe8f54777513ca75147b09cab45cff72 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea5a4c43ef35ffa93f5fbfc92141f81 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff2c5b9733ec454163a9488494edf997 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff7e72180fd3e02e6d7200fdef955547 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff3af10ffaca37bc586319c5192eb66a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff33eab7dc6d3226d1102772ab978300 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffc160c3e7316215a025037efa15b6b2 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fecabfee5d28bcf1dbe9837eb9bf21f8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff01fd164bd0c7d0b48dbaafa2f3343a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fef4dc770fdf4b5819aff59a8e35ae92 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fff79e47da2e0327a2dd0b7898926b69 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffacb1743eccf8156d4df4f58a559be5 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff6aca9f91151dd316a8d198cd3196d5 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff22648e54f244275e3f2bad60d2655e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffbc412103a9423374ef6831a5a15fe6 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffca872e2bea35a3571ccdb4f255080a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffe199b7355fddc600c742f4642c43fa success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff4ca27fa3c5e6317df89f86bcb97af6 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff30d49c15a9924e55e6009a6aa8d4ef success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff952cef6af47e386d2f2c74749dbb7a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffff7f0fc16efdf6a9beb0d6d5aa33d0 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feb9b4c60f50448fa2f82fdcdcf0c8bd success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff0dae34f555fc454d795f12facf11d5 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff0f3798ac8ca315bba3c15f183bc30f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff1f64f3d13cdea60a439f92e1a84f97 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffd4b123e030900a69fb54a5ad5cb310 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff9d57cea47ad2b0a9219b6911362adc success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff5e0a155e87dadbb671c1bdd1c837ee success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe4dc62580fe6db364b4ee860b235807 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff7c469e44d14af80041912c3a00d9d8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff3a5d6ef27aeb23a3a481fe8a28e8fd success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fff63049295cc3483d8838e88a961fd3 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fef620f1b633fbcd103347355d586a56 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff067d4deeca6610747a117dbf543aad success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fee5e091385be0adcd002376efd612b9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe796c1d8ab1536eaab4749cf688c67f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff3c065a9dfb545e3264423b32f51f32 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fff3c9b7424125851c9118c4d19871d3 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff8020b18586afe7e3dfe04f36ddfa05 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fff5b25b9ab4ad62d1a2d2f7ae5b3fc4 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fee9ecebc7aca542066d1ab0f30db0a5 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea3cb687d4ffbc51f427ae6a4568578 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fec49762c62b0e9055ad2157b40d1843 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffb944522102347f68c75711878499b3 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffe82f54f12423483557608593cf02be success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff0ea087ba9e1afbac4e2aaf7b41d053 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff6184f3a089ff176aba9e64e886c2b8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff50f50b44c00dc52c34a10e21c9fde5 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff59b371753be3795432ec96164a4f49 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff86a0ce3327f64783ee84873e4a48c0 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff200157ff3fcd7394ec73e5e030d598 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feef7a3f6f0b2e2d1d1421a2aa88b65d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffc76083445e28a7e4b314a07a8c3b6a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feb60bc1edca9dd01a0fd81b128455bb success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff7a7d0ea68cf95f3d4b14e3f2a30767 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff7b6f0c39299172a400f066783ce294 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe4d61074bb31d2906ffbf443ece46cc success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff89c3efb7835379e0ceb2f0910bb808 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffd44609731bb5fea01969b6e586822c success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff50b4aa1c9cc2197ef898436641c911 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feedaf62ffd9b46231694685edcd99e2 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff14d231f5b432140db2b49e2e7c60c2 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe4d18832ec73153724d3c9d8586a036 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffc19d63fc0765af2abf48a234a478f8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff0413a6b2da11605f5acbb99359f80c success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff2aeca981daed95240e6171b71b6879 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fffcb4d1e12c96b2f571f77ad25878b8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff10d6f519b8392d3f92e101ddca9096 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe986964dd5c25eeb1fed646200f778c success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feaf25ef2649ce6ecfdd7dd306da46a8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fed4fbd18b0f5143953e33a714baca30 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fff6dbf2e5d8d57fd080e69bde0eeafa success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa61491f2e0f86d9bea049c9bb531f5 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fee8627a6d536539b2278d0bf2c185d0 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fffa615d8cf8c2e49c2be1cdfdfda231 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fec3bf8141d2b352ab8123703204cb5e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffb9d2771a1f3b1b113ff3f0569b21e3 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fec14178f4c78c97f7c0d2dbf401a38d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feae531a8fed0de91533c2282758c267 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:febc63f661c435076dec498283e8bfac success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffb47c82efe6458fa5800ee59dfa4b1a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffd63b228f880321bb1901a386b9c0a1 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff6cd9a3ffdc1c9c9628deee887739ea success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffccb81bf171cbdfe01a521f4ffac4be success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe409731958af6ed61ecbffcdb73c418 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe91bfaddd5b642ecb62e8bf3dc419b4 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fef41ab1507a24e5a6e5a64201536b0a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff901e6882830fb6c47b00e0dd4f3288 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff494a034b34d1c626847a8b845a5286 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff20b399f02f29b142468b20c6745553 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fedc8a05c4785a30ef0f6dd9907fdaff success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe49889f08341fb912a54920de6f76a2 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fef796e643f5660875b32cb6ff0f9876 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe5fd4bca312f612db8b66ed3668bc8f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fef652e2c10c49532d31a1624bb9908f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff88074b464f080b5ed69f458667fa55 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fed78bbe81fc622fcd81299f48b64eaa success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe891ba8568b54fd553248f0994a4ce3 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe8dd89c35d7d6ba96e10e6c6acceb5a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fff098054378ec5ff7f594ac1d7fb136 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fefd96f2816e4c59b768fbd14825101f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea613e0e1c87923fc3624107d0615c4 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fec2de436256f0c1f6bdd78336202d7a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff0796d86fdd9ff61a5ef67f7adb24f6 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fed8de56415663d7db7da086de423c18 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff64ade9720c08fc422e4fd5dbb661ba success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe83173730ded7004a95c4ac4cae6f8b success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe4c3cadb75731d29427b6eeb16c4339 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff7fc205d226a6206e05e1294e43e5cc success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea43faef65b12094dc7d98c8dd52659 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fec1925231ec8ac905d1d0cc6bb1abd1 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fff9bb48faff771c958c35c21f8fc4d9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fef3e5c1a9db60277ca4e05482a7c6b2 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffe4e3854e6c390ad8e467af378f5ecc success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff83291af5ef62b881a0184cb1b12024 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff83dccb9b6040e415170b8d98ded52a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe998b1c2793d3e1d0f9b521e356104f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff9a8b5d1f4406d402a0a3c788dda2c7 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff9af30819fb3c2e35a54034824a183f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe7cd48561942bb77822abbfd088d76f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fff3f17b8411941d5f349bf32347b619 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe88941bb7c36ceda3692bef4f13a953 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff9c7fe1d55ecd859193df8c100462fc success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff2e0fcc30518fe5ec92ce05131eff6c success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff348abb5951543cdec60502e2944c6a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe4d0bb38a44d17b716368fd712c5ebf success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffb1910778ede5b91a13c253d6636de1 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa3bc932c9e4f22fdef0296e9450442 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe3f99de48063a2fbc0ac18e9168a57a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe416e992e1bd49ab3ad5db9bff86ea3 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa927fb8d63d6fad214445e9fec27b9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe6b7e3bc727ee6979befaa3d200c3d6 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff78fd22955715209bc84c026885f365 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa443112b6f582ec00fc54184ef8ede success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff4424aeb163ed6820a534c299f3d605 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe9251998c475065f3cf3870ee4bd2f7 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff8d348ba87c8a0f862ce242bd2f3430 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff5e9d5d4d90fcb150eca9df6997ec61 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff5332cf8801a5737dda959683ac72b7 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff75a67d678443e51958493923b22fd8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe9f531fa4182d8dc27bc2f255a476a3 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffcb6768ad0a8b631acd29355a31b50d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff00e8fa7f976bb36f4702ab3931225c success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fead382c59c03055bf466c1d5b09b2e8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff6373566745ecd54dad37c422a867c7 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fec7f132a02d6bce4ed696c791719aeb success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffe181130430aff6386df37df36347f8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe9230242a157544ba2aa21748b35258 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff576fc504da3d9670d9b4db0ec52421 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff0f5b11b1264d3bbe5ad3e062c5e92f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff3e8a3c0498477d8b4a8dbe3d1c0e6a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffb9e779055216e90e27c02cae5a3022 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe8352ce3bb84a383ab8cd287fd030bf success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:febf815d4ce550a3a6f881eb603b2eae success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa8c735b9c1eb256757fa22caaa3d14 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffb50738c93baf8063d53aa63a42df11 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe9f78994085d033fc242a337f66b469 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe6d869a70a564cbb7b6388ca052a478 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe607609e8256130fadb528fc1c7ba75 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff74f31a6d8e6a635c1b2f2bc869d8a4 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:febe88ba87b3676de9e4b39ed48398c8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feae060e6e11317d6cdc036c01d1e75f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffe4ab6240558b1f6e3a5de45c77206c success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff9f7ff58e507e623497a645d7976277 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fff960f72fb44578777b950ab7f680c7 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffef75ef03094771fb011905bf579fdb success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fee3d080a809adc794ba96bfd968ffbd success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffc50d65b004de5441c240d8057be627 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffd39c6043177f36944673ac1e482cf9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffd8bb05b0a9be6818e895641f8f6327 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fec132c8a1ba23a1d96258923656b889 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea22925913f4d86c9889d774f0b5c73 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff6c8572350c740990bbed3513fad525 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffcd87f75151f7c30b80083c5f776d9c success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff0bb3bdc52756fe9cd09a6512690040 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe6ca0b396b7906981f9bb2a62709126 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feec84a7a25ceb65394e412056c00784 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff71ff25b2b0033b0d9f68830728b4cc success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffc150a160d37e92012c196b6af4160d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffdbde8183a6333c8ea04f64cf375684 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa7e59931291ff93f59c15b81362628 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fee019dfa0281774a79c02f1430842b3 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff3476684bab167709f134102390c87b success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff5d2e614ba055e173dee2e5c3d83d3b success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff86feee1999ab39f079661715e7e15f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff0b27276aa9f5a2a12461afd85c3c6d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe5d2e510dd88eba530d6e020ccd8b04 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffcbf16953a67678a73a03da47e51772 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffac41b3f9daceeb8f7d9bf7e6658058 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feb3918a7d7d36374b5b9722363a4004 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff4abc570bc6b074e898bb3d2788d560 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff1958706a2f5e9461cd747aaa5977d6 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff1d4b60a37c200f11f9c21a3fc494e3 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe44f6d608162c3b8238cadaf183a5ee success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea289feb3be9393b7e2628b962b6403 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe9ee89a6d1ca0a780975bc50dead4b3 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe4add53d9368ea5c9a30600286a0889 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fef8528d50d7676cf3abe68307df6988 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff5c0716b8832d16ab24334dbc5c2b73 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feecddf5707ddedbabaf3673f9c6d6fc success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffd7837cc7e2f4d436ff65803c9417de success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff9c072d42a94d0a5112613019b54eae success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff09a0f8bdf64d17fc9fe0c9bfb94fce success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe5eb5765a5fff53739e5abeb9fcd30d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff6c7a4d122cee88085f9cf34ec553d1 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff22a840f6efe83ed19a8adaf552ce3b success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe952245fefed65df025a9e68073b34c success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff8bed43ac09b1148fc7648f5845f698 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff961df44422f6cbc7b9544b49eb6fdf success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feb60133e457a137eb8600ec30fd23f1 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feb45fa322c67b3ff5044c87807b38ed success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff07554d679d3d95092a49cf1a1b3e75 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff3649dff7af9328416cb02fc272beb7 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff64522a4acf06349be7e4d5680a6a12 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa4ba973372c3650fd0881abeca6512 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff9eb8bd8c927da073cea632f294e23b success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe84ca3dd279e48303b9230b752a2767 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff56f0bc71a04a29a20996ac86ac6fdb success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff059b74ffd2710901a855390e36a1fc success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff8e237030e711e1c33c1476c4d5e67e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff89f59f93d06882e41dc2cef15abf9c success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe7b6f9ace35ffbfcdceeda696fa5f1c success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff38faefedd9b7721a283acad81b988f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff7335291cf125a6d0a1ec151a354657 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fff919717aa6e3b32d1b09e37b90fee9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe5383fe15ff9bbd4d33d9f60d25c5d6 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe5fdecb611bd8ef043a62286ea7a740 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffd3062dd44e67acf44503d2fa29c049 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feeda2156f95e45e82077f117161c706 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa72428d3d6042dffc898d0a15f5305 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffe9fe34ce1f778c097241206fad3afd success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff2ff06d4fc5be8f34c950ee28743462 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa99e390421c5d85a3dfbfc2b987885 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff4cf8fd0dafbb33ae2ceb1b4ff0e476 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe7b771b1676e280cd98d0c8eee38f3e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff877e69b4865e11f8da0d78268548c1 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff368354e1aca6421dc095dd4b27b29d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff8e161b47b8737e0acb578315e6a8f7 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe4e953502a1ef07208091d18b63a4f8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff20b78a02725d8048ce9246f69ba53f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff99070fd47a6591e4436d8243fb216f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa74017e3c2cc3e4635a488f4fdba74 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff59be4031517cb40d53613f7221c3a5 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff8224c46062022b6feaed27ce5e9e61 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff0e56050b1727f5d401ce444eca5cd5 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe8c58c66f5921df6a7ec554f90fc7a1 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fec8b43d262bb510f873240df847a1de success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff923cd9935342f210a91c93661e8405 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff6d3e923fb3b7115afc111b5b4ea538 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff445985ab97ef5ddebcad378bea73b9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff7404fac37a9c7122d8361cbd5a69b2 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff5179ed5cea9e9d068e787f81b1469e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff85df8114692296a4cb5d00495de6f7 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe7da27751ce3e844d37031086197a97 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feeab4635c04ad3f02cc0e27064cdf60 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff6e2549a13d5498d86ba7801a226c62 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fefd2a7c94563a749f82148e229ca258 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fff2191f6e3f7e927fd5e44e1e0b6f34 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff82d3a70a33df58cdc57f6bf647f8b8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe8688eaa808165bfb38b291fb25b9f8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff6148388c5de9aed2739d52f3563ff9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff23765bfdedd8122a9e3ec348c117ce success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff8f4688ff3fae8b0c163671fec8d125 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feb2c2847da5e274f3d530d5ab438af8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fef79defea392829a9de35fff626f6d9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffdacd29d860e4e8ec1eecc7e07de30b success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffaed17281759fc35623c004a9da859d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe7d4528a6882cee9538be41e2302648 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffbcfbece37c66c50b33e8c3b20013f7 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff66c68a41bb4531d16b96319c767b0b success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feb959b7f607fdf31ca48c8ac6ea4728 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea500301ccd559554f0be4e640d14c5 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea5cfb8c1be088e96fcf45abea9d339 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffd4e49ee67f6e5e0dc508ab46f47422 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff2724276b671c215f98b7e775496400 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff1266fb2e251e017f8c407e94261d63 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff110bea215ee4c5036b320b2147145a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff2475e77f540590bff19c0a2b4f6ba6 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffd816376208ff6a9b93cd65895af94d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe89cba177bacce23f16661a85c8d633 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fedf6ed4cfbdec9179cc093834438c16 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea1ff94ff26bc390898735c2b66377e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffafabe99d9e903d756f7efe2546a79b success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff7df31ff5814c4544498f19b782fe84 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff9df8a9a39bb936ece17b6e9ad736ef success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff29f3eaf1dcdd20683bc4e814065c01 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffaff99116fc85ddaf0a0e86dea44a2a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff69c2de3482a1be56a6a9799d7777e4 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa1291f20dd12a9a4292f8559044f61 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa2fab14443c434da74e3580a53d6f3 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff6e1ba60eaf374397210a24ea08ebca success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffb08297fa48e6530f1952efdc194423 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe898684e4cedd062d352b4f3c88cc35 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa1f30465bdfe9e28ef9dea3d608554 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fffa54f58e8558375eef6156f1a899f6 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff7fa80e042ba49754d149fc5e09f29f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff5048d45b2e0d706b6813f7fe0df107 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feae297b714d3b55db6660e4cec8980a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fffd363428a35b4e3e8ef7cb4c6196d8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fef6f523afd0af8497cb86b66c2e4378 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe7265c2d1545a0f0594a359f21f83db success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa955a33e89de7a72073dc636fac426 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff4231348f11087e69dd457403c41940 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff77f55120af0aec08ffae6f0ebbce36 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feaae2194c3938b1ff48170efcf7b43f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffcbe9ed8d90a37e4eab0a30dbec68b2 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fee5b4f21496561c8ae567ab7c49a776 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff243c0f6a30b9f99eda2e5b72c0aabc success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe54db8d5321687a58e44718047d3bd7 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea54db8eaef0356a7e5d632d54f54b8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fed3ee71101b65ead83fdc515f596dd9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff3f34751ce4706509156235dfdf35b8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff0731257100f18d2ea5eaf49b2b1562 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe80a18fb984e26a63ee98ff0e355489 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fffa157936762aef15bc2326c5e78e55 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff41887b5bb497e2d98e7d5f69b58164 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff81d5d8d0d39d672cec210e75973b17 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fef5ded427d69048e93a02954620692e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff14d9bb1b11f5ec750130c2dcdd71df success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffadd1a2815578e79396ea88fca46f9b success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea0f1f6fede90bd0a925b4194deac11 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea9f602c07c73d223d5bb4d8f8a0565 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff65edf9a7889a4d6281f6935e3aee92 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff54a1f0e80e657a513892ee152bd23f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff338c7d9a0f74e5657f2e21d16721be success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe3ff4be4b3d0470f29c0c3893d70d71 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe764ea41443c5f9d56627de190d2273 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff11cfb57fba02752de34921c35ec9fe success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff3386c777d6861207429a10b4f94cd4 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe89af0bcdb0ff0ca49b64e984e8d9ee success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feb16741986a2c64d98b339bbc2a8c81 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feaa817a33fc7cb96b5389155db141df success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feed534937f8d608461800b894c1a90b success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff5e38fc492baa60041bea7aa4993f8d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff26e1d97e637587e7c230d4cd5ff227 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffcff559136c368ba616e35f8544a7f2 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff4d491f06068f4d218fce5782802408 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea9125096b11afd14230550651b491f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fffd20475262a0c9f0eef50882ccf1bc success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe7385ddc149cc60216e7713ac0f8af4 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe83d36f75f15f9c23ad9e9e890d2d24 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffcc5643e5f154b64fd6765674879f7e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe9ddc5289c68cfc37f38dc2477af473 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffe0170dbd161802c1a0f89e54bf1739 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fff0e61d5b11297e476c36594db9fdd7 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff3b7db9269350dca15a34f3772a56c9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff64859d57ebd32e986c1fa777dde874 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff1732fff464b5739c621c4c35f145a3 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff161bcd7b102a6d6d45eb4f9f56f466 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff72708af95c5c707c7376423c0a8374 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe41e059892ba19e10b4ca999d508c6a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffca22797eb7987477b61ebe3a695265 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff9a4b31543e29d2e35269dbf516e456 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe9d120fb94711cf35137a589770d742 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff312ee801380d79817eac758ef2a0a9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffe101f5285d741db79d459a9346a795 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa77d1bfcf1d296040f1d2a3a2073a0 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fff99119325bedcef64cbda19bb0b828 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff80dfbce002877976724fc5436edf43 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffb4c2267882473d1c46fc5804173c9e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe3b35a1f6a178847ada63fc47df7519 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fed9d9be4fba9d96b4e6f47e4539df47 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea3e499822a074968faeb8e8fd1ad4b success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffed2e6656439077368214fca556bdae success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea9dffa16d15aba23ec3994d9d1d329 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff7cdd14c3ee6a65c5c8f87322527e88 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff08f15a82775222dee349d6f97dc344 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffe24fc2345ec3f3fad8c03564f4fd76 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feb48c2ed54d4efc3cd69d96765964c0 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe50d31d2ecec92551ff0a66df5c2550 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffb8a914fd682ad6a670d31c907caaf4 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff150915ea25e452500bb2019248186d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe3c32a4d3509eddcd851371564d481f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fec0a13adfae32b3f831b1ab0017dc63 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff4ee19e3cdd54acc4e897ba613e4e19 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fefd0a192ee2bf3c3b56179e165e7748 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff94b93682a7bb18a97d720c82e253cb success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fec46247845bcd11ec6b26a46b3e256a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe44d35651f384673c3aafb24a9adbb3 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe947277c7ba6b0e25bd17c32ace85ee success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff3422210a088799f68e69aa972892bd success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffbad3d1f3e38cf34f4df1b888b786dd success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff0cf4613ed77445816a97d8fe9f7ee6 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff36ae38b7cca336974ece66fb4fea53 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffe9d0b537b7f390408b25a78bdebf00 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff483d1ff591898a9942916050d2ca3f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe8200214a0ed1b5b4ac192fcef1ab0d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea188096d8affa7c9ff097abf9e489b success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feaa1390bc238203e44186bfa483b453 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe3e52658ec1a304a0aa3224a52775d8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff750820dbd90b025ca66f1508cccdab success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffb7a424cc6f79d02a021540e4643ebc success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffef8ce5b579fbd746fbc6f6580983db success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff76f977bcf6e5d5e92f45a01b940a91 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffdda2ba56326a773a02126331363c4e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe42900303525c5f6ec7a912f79ada80 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fed6ba98ae49ae658af4f4e6b523bb25 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffd6235ec258eabb55ac94c8bc6ed4cf success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff9351a88a3865f6bf366e459e304561 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff28bed3ea14b6e4eea25c17a5b6cb53 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffc443e8ce3cf8c60b1399d35e34ad4c success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff740e6b59e4a498da05aec574f561d6 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe6fed3bd0619727ce8616c1f8ab5cd2 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe7a8a2a1bd3c8bcffbecc7ce8d1b0a9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feaa8a3e371162bf38c97824db80b69f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:febdb3465c08d7bd3f9a40aa87c1cc76 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffc6e8c83a37cd3f1f97744b2decdf93 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe9af581fc29063aed1a07c698f01e31 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff44f64da1fd6f262c7838275ce99f39 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fef300fac7b4062e819b499c1b4b13b1 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe88a1a2f87d79af92d083dc306896b7 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffffb85cb625abe7f98d628ea24a6773 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fefaeb3c387eaefd527f905803004b1f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe5f1954649bba49db89e5f6d1942e28 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff5e57c18365080d110c10f26bbf2ccb success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffceb58071d323818a0a4b232e9ba0ae success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffb639dbbcb60ed11325fd12a182da95 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff9bc37a63c7c27dfb5480c79f636ca0 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffe3c697dadefa1cc708e9a05d1e13d5 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff84057b4ec225f4d9d89f649eb04386 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe520022e5a0b50782ea036b9b82c9aa success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea08b46eb6089a968f7e42a293ed202 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff0218519d55ff6dafced303c5962d2f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff6dc0b005d10e856770b16d986b9370 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff0d813dd5d2f64dd372c6c4b6aed086 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe74a50bf0eb2cebe0d8b8edeebf9930 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fef0a1abb83340a7943734476b917340 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feae6a84687c32d961c8635c97aef69d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff17334da88e72537900df5a1ec2cb0e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe86a8dbdee527f80a16d9fceb45b311 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff2e1bdc2e74708c32db2b7e204a0a3a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffa1cc310af22b1c10459050a92c903e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffdefe711197626bca128022eb03119f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff2fe49cec086b86ae2a3f3a838ec02d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff399cf141370af91060b4d3c269512d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffe9668c0f950968b974111aa2061a99 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff40f26fdf2a39c708d2f7bc4836413d success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fed18e76731518c23b1c18b7b95947c2 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffebd91098ecea369ab68f63aa69273c success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff757da863d5b87c9695316018b27315 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff1cd0ac6a0ef21ddcf6db8c50a289b9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffe9148e17734bb87a390ba3bf2353cd success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fee45f9086ff16bc66d8f86b5b983217 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe66daa6d1f209cba30fad24f1a011a4 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff2bd6eb7ea03949b238bef1a923184e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe5af7e374fbe6a64efdb535c10a093f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:febb7bbea02628b9fe52b179235ea3cb success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe6e4a693eb12c3b798d8dafc33fb9ec success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe992d3ca40848f98c7d73dfa15a81f9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feab803a4cb524b65c84dd97f69082de success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fea5ffa7130ed08ed654923ead7cca48 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fee5ad3a780a2454b852f2d8d78344e8 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fedc762c6740b053d1d93b1203ad8e0e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe4dbd8c1f44998c5ecd98ab8d269220 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffc3151c519bac02440433836467f561 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe8cc587423a6ccfe2c245f8cd41f844 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffb749be63b3e04b1dddc5c1c16de257 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff07475e049afc7a77309b6ea41b5f50 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe72681ac3f843d4f42ab8e1d8b72110 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fef7dcc3f1447f7c1fc78ae9863ad261 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff34b235032aa1fa8329e300dbeee03f success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe7cb71eb1bcbee03dbd1af6962edf9a success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff9ddd7bb640e8d4708064afe4e0a594 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff8c8f4bef0f1dcf5c06c5e1c048a8c9 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ffe5b0d01c8b734e35225962c3584a58 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe8965a9748c1bc48af1711be837124e success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe5ffa3b2065863a29c8c33415db0418 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:fe9f949a398dc45d812ca90bc22d5abf success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:feed16fa58610f92c51e6cf16eaee0a4 success.\n",
            "insert_or_update_one_userproex_4_median start\n",
            "update userid:ff00b86015b157cf21d9a75363d9e9b3 success.\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "metadata": {
        "id": "55ETlu7mWGUx",
        "colab_type": "code",
        "outputId": "84f79e8d-c30c-42e3-a0dc-1061c6870e03",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "print(datetime.datetime.now())\n",
        "end_time = datetime.datetime.now()\n",
        "print(end_time - start_time)"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "2018-12-19 11:10:31.568195\n",
            "0:00:17.952835\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "metadata": {
        "collapsed": true,
        "id": "hTJJFa3dWGU1",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "## 增量处理数据（这部分在实际的工程代码中，替换为使用数据库的mqlog表，把这张表当做消息队列来使用，和log思路一致，针对user这部分,  mqlog中的消息类型为‘u’）\n",
        "\n",
        "* 根据支持，传入user list\n",
        "\n",
        "* 根据user list, 更新max，min, avg, sum, count， median等值"
      ]
    },
    {
      "metadata": {
        "id": "503i0NGnWGU2",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "def get_user_list_in_log(is_all_or_sample, process_func, insert_or_update_func):\n",
        "    connection = get_connection()\n",
        "    if is_all_or_sample:\n",
        "        sql = 'select DISTINCT userid from comment_new_log where userid is not null and active=1'\n",
        "    else:\n",
        "        sql = 'select DISTINCT userid from comment_new_log where userid is not null and active=1 limit 0,10'\n",
        "        \n",
        "    try:\n",
        "        with connection.cursor() as cursor:\n",
        "            cursor.execute(sql)\n",
        "        connection.commit()\n",
        "        while True:\n",
        "            r = cursor.fetchone()\n",
        "            if r == None:\n",
        "                break\n",
        "            process_func(r[0], insert_or_update_func)\n",
        "            with connection.cursor() as cursor:\n",
        "                update_sql = 'update comment_new_log set active=0 where userid=\\'%s\\'' % r[0]\n",
        "                cursor.execute(update_sql)\n",
        "            connection.commit()\n",
        "    except Exception as e:\n",
        "        print(e)\n",
        "        connection.close()\n",
        "    connection.close()"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "metadata": {
        "id": "DpQxIFCGWGU6",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "#get_user_list_in_log(False, process_per_user, insert_or_update_one_userproex)"
      ],
      "execution_count": 0,
      "outputs": []
    }
  ]
}